package com.smart.manage.service.impl;

import java.util.List;
import com.smart.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.manage.mapper.PatientsAppointmentMapper;
import com.smart.manage.domain.PatientsAppointment;
import com.smart.manage.service.IPatientsAppointmentService;

/**
 * 就诊人预约挂号Service业务层处理
 * 
 * @author lingyao
 * @date 2025-03-01
 */
@Service
public class PatientsAppointmentServiceImpl implements IPatientsAppointmentService 
{
    @Autowired
    private PatientsAppointmentMapper patientsAppointmentMapper;

    /**
     * 查询就诊人预约挂号
     * 
     * @param id 就诊人预约挂号主键
     * @return 就诊人预约挂号
     */
    @Override
    public PatientsAppointment selectPatientsAppointmentById(Long id)
    {
        return patientsAppointmentMapper.selectPatientsAppointmentById(id);
    }

    /**
     * 查询就诊人预约挂号列表
     * 
     * @param patientsAppointment 就诊人预约挂号
     * @return 就诊人预约挂号
     */
    @Override
    public List<PatientsAppointment> selectPatientsAppointmentList(PatientsAppointment patientsAppointment)
    {
        return patientsAppointmentMapper.selectPatientsAppointmentList(patientsAppointment);
    }

    /**
     * 新增就诊人预约挂号
     * 
     * @param patientsAppointment 就诊人预约挂号
     * @return 结果
     */
    @Override
    public int insertPatientsAppointment(PatientsAppointment patientsAppointment)
    {
        patientsAppointment.setCreateTime(DateUtils.getNowDate());
        return patientsAppointmentMapper.insertPatientsAppointment(patientsAppointment);
    }

    /**
     * 修改就诊人预约挂号
     * 
     * @param patientsAppointment 就诊人预约挂号
     * @return 结果
     */
    @Override
    public int updatePatientsAppointment(PatientsAppointment patientsAppointment)
    {
        patientsAppointment.setUpdateTime(DateUtils.getNowDate());
        return patientsAppointmentMapper.updatePatientsAppointment(patientsAppointment);
    }

    /**
     * 批量删除就诊人预约挂号
     * 
     * @param ids 需要删除的就诊人预约挂号主键
     * @return 结果
     */
    @Override
    public int deletePatientsAppointmentByIds(Long[] ids)
    {
        return patientsAppointmentMapper.deletePatientsAppointmentByIds(ids);
    }

    /**
     * 删除就诊人预约挂号信息
     * 
     * @param id 就诊人预约挂号主键
     * @return 结果
     */
    @Override
    public int deletePatientsAppointmentById(Long id)
    {
        return patientsAppointmentMapper.deletePatientsAppointmentById(id);
    }
}
